/* class Person{
    name:string
    age:number
    constructor(name:string,age:number){
        this.name = name;
        this.age = age;
    }
    getName():void{
        console.log(this.name);
        
    }
}
var p:Person = new Person("cheng",20);
p.getName(); */

// 没构造函数
class Person{
    // static skill:string = "js"//undefined
    name:string
    age:number
    getName():void{
        console.log(this.name);//实例的name
    }
}
var p:Person = new Person();
p.getName();